package com.yanqu.road.server.cmd.activity.biaoju.task;

import com.yanqu.road.entity.activity.biaoju.UserBiaoJuData;
import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.logic.activity.biaoju.BiaoJuConfig;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.BiaoJuProto;
import com.yanqu.road.server.cmd.base.BaseTask;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.biaoju.ActivityBiaoJuModule;
import com.yanqu.road.server.gameplayer.module.activity.fund.ActivityFundModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.biaoju.BiaoJuConfigMgr;
import com.yanqu.road.server.manger.maidian.biaoju.BiaoJuLog;
import com.yanqu.road.server.manger.player.GamePlayerMgr;

public class BiaoJuEscortEndDataTask extends BaseTask {
    private BiaoJuProto.CrossBiaoJuRunEndSyncMsg respMsg;

    public BiaoJuEscortEndDataTask(YanQuMessage packet, GamePlayer player) {
        super(packet, player);
    }

    @Override
    protected boolean parseData() throws Exception {
        respMsg = BiaoJuProto.CrossBiaoJuRunEndSyncMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    protected void execute() {
        long userId = packet.getPlayerId();
        GamePlayer playerGet = GamePlayerMgr.getPlayer(userId);
        if (playerGet == null) {
            getLOGGER().error("玩家不存在 userId:{}", userId);
            return;
        }

        BiaoJuLog.traceEscortEnd(playerGet, respMsg);
        playerGet.notifyListener(eGamePlayerEventType.BiaoJuExp.getValue(), respMsg.getNowExp());
    }

    @Override
    protected void sendData(GamePlayer player) {

    }
}
